#!/bin/bash

case "$1" in

  start)
    nohup java -Djava.ext.dirs=./lib com.linkstec.stormmonitor.Monitor >/dev/null 2>&1 &
    echo $! > stormmonitor.pid
    ;;

  stop)
    kill `cat stormmonitor.pid`
    rm -rf stormmonitor.pid
    ;;

  restart)
    $0 stop
    sleep 1
    $0 start
    ;;

  *)
    echo "Usage: run.sh {start|stop|restart}"
    ;;

esac

exit 0